package com.ruoyi.project.datum.view.service;

import com.ruoyi.project.datum.manage.domain.Manage;
import com.ruoyi.project.datum.manage.mapper.ManageMapper;
import com.ruoyi.project.datum.view.domain.Photo;
import com.ruoyi.project.datum.view.mapper.ViewMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 描述：查看产品 处理业务层
 * 时间：2020/5/20
 * 作者：WangHaiDong
 */
@Service
public class ViewServiceImpl implements IViewService {

    @Autowired
    private ViewMapper viewMapper;

    @Autowired
    private ManageMapper manageMapper;

    @Override
    public List<Photo> selectPhotoList(Photo photo) {
        return viewMapper.selectPhotoList(photo);
    }

    /**
     * 修改显示状态
     * @param photo
     * @return
     */
    @Override
    public int changePhoGalShow(Photo photo) {
        return viewMapper.changePhoGalShow(photo);
    }

    /**
     * 修改产品信息收藏
     * @param manage
     * @return
     */
    @Override
    public int changeManageCollect(Manage manage) {
        return manageMapper.changeManageCollect(manage);
    }

    /**
     * 根据图片ID 查询信息
     * @param phoGalId
     * @return
     */
    @Override
    public Photo selectPhotoById(Long phoGalId) {
        return viewMapper.selectPhotoById(phoGalId);
    }

    /**
     * 根据图片ID 修改图片信息
     * @param photo
     * @return
     */
    @Override
    public int updatePhoto(Photo photo) {
        return viewMapper.updatePhoto(photo);
    }
}
